/*************************************************************************
 * AUTHOR		 : Chris Hayes
 * STUDENT ID	 : 656960
 * ASSIGNMENT #5 : Multi-Dimensional Array - Tic Tac Toe
 * CLASS		 : CS1B
 * SECTION		 : MW12:30
 * DUE DATE		 : June 15, 2011
 *************************************************************************/

#include "tictacheader.h"

/**************************************************************************
* FUNCTION Welcome
*__________________________________________________________________________
* This function uses a text file named welcome.txt to display a welcome
* 	screen.  It reads in each line of the text file and outputs it to the
* 	screen.  It then waits for the user to hit enter.
*__________________________________________________________________________
* PRE-CONDITIONS
*  welcome.txt : Must be in the same folder as the executable
*
* POST-CONDITIONS
*  There are no post-conditions for this function
*  -->Outputs to the screen
**************************************************************************/

void Welcome()
{
	//VARIABLES
	string lineOutput;	//used to store the curren line being read in from
						// the input file.					- CALC & OUT
	ifstream welcome;	//Input file contain the welcome mesagge
						//									- INPUT
	int lineCount;		//Keep track of what line the file is on
						//									- CALC

	//Clear the screen
	system("clear");

	//Initialize line count
	lineCount = 1;

	//open the input file
	welcome.open("welcome.txt");

	//read in the input file and output it to the screen
	while(welcome && lineCount <= 29)
	{
		getline(welcome, lineOutput);

		cout << lineOutput << endl;
		lineCount++;
	}

	//wait until the user hits enter so the welcome screen stays up
	cin.ignore(1000, '\n');

	//close the input file
	welcome.close();

	system("clear");
}
